home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / Open Transport / Sample Code / DLPI / ATM PCI DLPI / ATMIncludes / OpenTptAtm.h
Encoding:
C/C++ Source or Header  |  1995-08-03  |  3.6 KB  |  172 lines  |  [TEXT/MPS ]

  1. /***********************************************************
  2.     File:        OpenTptAtm.h
  3.  
  4.     Contains:    Public ATM definitions
  5.  
  6.     Written by:    
  7.  
  8.     Copyright:    © 1994-95 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.  
  13.     To Do:
  14.  ***********************************************************/
  15.  
  16.  
  17. #ifndef __OPENTPTATM__
  18. #define __OPENTPTATM__
  19.  
  20. /***********************************************************
  21.   INCLUDES
  22.  ***********************************************************/
  23.  
  24. #ifndef __OPENTRANSPORT__
  25. #include <OpenTransport.h>
  26. #endif
  27.  
  28. /***********************************************************
  29.   DEFINES, STRUCTS AND TYPEDEFS
  30.  ***********************************************************/
  31.  
  32. /*###########################
  33.  ATM Modules Names
  34.  ###########################*/
  35.  
  36. /* ATM RAW AAL Access Module Name */
  37. #define kATMRawName            "rawatm"
  38.  
  39. /* ATM Device Module ID */
  40. #define kATMModuleID        10000
  41.  
  42. /*###########################
  43.  ATM Addressing
  44.  ###########################*/
  45.  
  46. /* ATM Address types / masks */
  47. enum {
  48.     kPVCAddressType            = 0x0000000B,
  49.     kSVCAddressType            = 0x00010000,
  50.     kUNIAddressType            = 0x00010100,
  51.     kUNIPrivateAddressType    = 0x00010101,
  52.     kUNIPublicAddressType    = 0x00010102,
  53.     kUnknownAddressType        = 0x00000000
  54. };
  55.  
  56. /* PVC Address structure */
  57. typedef struct _PVCAddress {
  58.     UInt32    addressType;
  59.     UInt16     vpi;
  60.     UInt16     vci;
  61. } PVCAddress;
  62.  
  63. #define kMaxUNIAddressOctets        20
  64. #define kUNIPrivateAddressOctets    20
  65. #define kUNIPublicAddressOctets        8
  66.  
  67. /* ATM Address structure */
  68. typedef struct _UNIAddress {
  69.     UInt32            addressType;
  70.     UInt8            addr[kMaxUNIAddressOctets];
  71. } UNIAddress;
  72.  
  73. #define kATMAddressLength    32
  74.  
  75. /* ATM Address structure */
  76. typedef union _ATMAddress {
  77.     UInt32            addressType;
  78.     PVCAddress        pvc;
  79.     UNIAddress        uni;
  80.     UInt8            max[kATMAddressLength];
  81. } ATMAddress;
  82.  
  83. /*###########################
  84.  ATM Traffic Parameters
  85.  ###########################*/
  86.  
  87. /* ATM AAL types */
  88.  
  89. typedef UInt32 AALType;
  90.  
  91. enum {
  92.     kAALTypeNull    = 0,
  93.     kAALType1        = 1,
  94.     kAALType2        = 2,
  95.     kAALType34        = 3,
  96.     kAALType5        = 5,
  97.     kAALTypeUser    = 16
  98. };
  99.  
  100. /* PVC QOS specification structure */
  101. typedef struct _QOSClass {
  102.     UInt8    fwd;
  103.     UInt8    bwd;
  104.     UInt16    padding;
  105. } QOSClass;
  106.  
  107. /* QOS Classes */
  108. enum {
  109.     kQOSClass0                = 0,
  110.     kQOSClassUnspecified    = 0,
  111.     kQOSClass1                = 1,
  112.     kQOSClass2                = 2,
  113.     kQOSClass3                = 3,
  114.     kQOSClass4                = 4
  115. };
  116.  
  117. /* PVC Traffic descriptor specification structure */
  118. typedef struct _TrafficDesc {
  119.     UInt32    fwdPeakCellRate0;
  120.     UInt32    bwdPeakCellRate0;
  121.     UInt32    fwdPeakCellRate01;
  122.     UInt32    bwdPeakCellRate01;
  123.     UInt32    fwdSustCellRate0;
  124.     UInt32    bwdSustCellRate0;
  125.     UInt32    fwdSustCellRate01;
  126.     UInt32    bwdSustCellRate01;
  127.     UInt32    fwdMeanBurstSize0;
  128.     UInt32    bwdMeanBurstSize0;
  129.     UInt32    fwdMeanBurstSize01;
  130.     UInt32    bwdMeanBurstSize01;
  131.     UInt8    bstEffortReq;
  132.     UInt8    fwdTagReq;
  133.     UInt8    bwdTagReq;
  134.     UInt8    padding;
  135. } TrafficDesc;
  136.  
  137. /*###########################
  138.  ATM PVC Related
  139.  ###########################*/
  140.  
  141. /* ATM PVC connect message data structure */
  142. typedef struct _ATMVCParams {
  143.     AALType            aal;
  144.     QOSClass        qos;
  145.     TrafficDesc        traffic;
  146. } ATMVCParams;
  147.  
  148. /*###########################
  149.  ATM DLPI Driver Related
  150.  ###########################*/
  151.  
  152. typedef struct _ATMSimpleQOS {
  153.     UInt32            dl_qos_type;
  154.     ATMVCParams        params;
  155. } ATMSimpleQOS;
  156.  
  157. /* QOS structures used by the ATM DLPI Driver */
  158. #define DL_QOS_SIMPLE_ATM            0x0701
  159. #define DL_QOS_SIMPLE_ATM_RANGE        0x0702
  160.  
  161. /* IOCTLs used by the ATM DLPI Driver */
  162. #define DL_IOC_SUBS_CONNECT            20
  163. #define DL_IOC_SUBS_DISCONNECT        21
  164.  
  165. /* ATM Physical Address Length */
  166. #define kATMPhysicalAddressLength    6
  167.  
  168. /* A good DL_UNITDATA_IND mblk size */
  169. #define kGoodUDIndSize                128
  170.  
  171. #endif        /* __OPENTPTATM__ */
  172.